﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using PPAP.DAO;
using PPAP.Model;

namespace PPAP.BO
{
    public class PARTBO
    {
        public PARTBO() { }
        PARTDAO dao = new PARTDAO();
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(PART model)
        {
            return dao.Add(model);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int AddExcel(PART model)
        {
            return dao.AddExcel(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(PART model)
        {
            return dao.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public int Delete(int id)
        {
            return dao.Delete(id);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public PART GetModel(int id)
        {
            return dao.GetModel(id);
        }

        /// <summary>
        /// 根据PPARid得到一个对象实体
        /// </summary>
        public PART GetModelForPPARid(int id)
        {
            return dao.GetModelForPPARid(id);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dao.GetList(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetListByWhere(string strWhere)
        {
            return dao.GetListByWhere(strWhere);
        }

        /// <summary>
        /// 分配工厂
        /// </summary>
        /// <param name="part"></param>
        /// <returns></returns>
        public int PlantAllot(PART part)
        {
            return dao.PlantAllot(part);
        }
    }
}
